package rest

import (
	"errors"
	"github.com/gin-gonic/gin"
	"monoblog/common"
	"monoblog/domain/auth"
)

/*
统计&汇总接口
*/

// SummaryUser 汇总页的统计
func SummaryUser(ctx *gin.Context) {
	var userId string // 用户ID

	if user, ok := ctx.Get("user"); ok {
		userId = user.(*auth.LoginUser).UID
	} else {
		common.Fail(ctx, "用户未登录", errors.New("user not login"))
		return
	}

	common.Success(ctx, userId)
}
